<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_whats_new.php 6128 2007-04-08 04:53:32Z birdbrain $
 */
  $content_new ='';
  $content = "";
  $whats_new_box_counter = 0;
  while (!$random_whats_new_sidebox_product->EOF) {
    $whats_new_box_counter++;
    $whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
	$whats_new_price = '<br/>'.str_replace('<br/>','',$whats_new_price);
    $content .= '<div class="sideBoxContent centeredContent">';
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
    $content .= '<br />' . substr($random_whats_new_sidebox_product->fields['products_name'],0,20) . '</a>';
    $content .= '<div>' . $whats_new_price . '</div>';
    $content .= '</div>';
	
	
	$product_img_url ="";
	$product_img_num = $random_whats_new_sidebox_product->fields['products_image_num'];
	if($product_img_num > 0){
		$product_img_url = DIR_WS_PRO_SMALL. $random_whats_new_sidebox_product->fields['products_image'].'_1.jpg';
	}else{
		$product_img_url = DIR_WS_PRO_SMALLOLD. $random_whats_new_sidebox_product->fields['products_image'].'_t.jpg';
	}
	
	$content_new .= '<li>';
	$hreflink = zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']);
    $content_new .= '<a href="' . $hreflink . '">' . zen_image($product_img_url, $random_whats_new_sidebox_product->fields['products_name'], NULL, NULL) . '</a>';
    $content_new .= '<div class="tit"><a href="' . $hreflink . '">' . $random_whats_new_sidebox_product->fields['products_name'] . '</a>';
    $content_new .= '<span>' . $whats_new_price . '</span></div>';
    $content_new .= '</li>';
	
    $random_whats_new_sidebox_product->MoveNextRandom();
  }

?>
